home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor1
/
uuencode.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
3KB
|
58 lines
UUENCODE/UUDECODE by Theodore A. Kaldis
This article by James H. Cloos
Date: Wed Feb 13 1991
[Note: Since things are often posted on the comp.sys.handhelds conference on
HP's Corvallis BBS in "unix-to-unix-encoded" (uuencoded) format, the serious
bbs-er needs a uudecoder. It's on this disk, called "UUDECODE". To use it,
type UUDECODE FILENAME at the DOS prompt, where 'filename' contains the
captured text from the "begin" to the "end" lines. If you want to uuencode
something yourself so that you can upload it to the bbs, use UUENCODE FILENAME
which creates a copy of 'filename' with a .UUE extension. Theodore Kaldis has
put this programs into the public domain with the understanding that they will
not be sold for profit. See also EXTRACT2.DOC on this disk. -jkh-]
For those who are interested, below is the format of uuencoded files. I know I
said that I'd work on translating it to the 48, but I've been flooded by rplc,
a project for class (a Huffman encoding exercise) and various other homework
assignments, ergo: no uuencode/decode for the 48 from me for a while! If
anyone else wants to try, it looks like this:
Files output by uuencode(1C) consist of a header line, followed by a
number of body lines, and a trailer line. uudecode (see
uuencode(1C)) will ignore any lines preceding the header or following
the trailer. Lines preceding a header must not, of course, look like
a header.
The header line is distinguished by having the first 6 characters
`begin '. The word begin is followed by a mode (in octal), and a
string which names the remote file. Spaces separate the three items
in the header line.
The body consists of a number of lines, each at most 62 characters
long (including the trailing NEWLINE). These consist of a character
count, followed by encoded characters, followed by a NEWLINE. The
character count is a single printing character, and represents an
integer, the number of bytes the rest of the line represents. Such
integers are always in the range from 0 to 63 and can be determined
by subtracting the character space (octal 40) from the character.
Groups of 3 bytes are stored in 4 characters, 6 bits per character.
All are offset by a SPACE to make the characters printing. The last
line may be shorter than the normal 45 bytes. If the size is not a
multiple of 3, this fact can be determined by the value of the count
on the last line. Extra garbage will be included to make the
character count a multiple of 4. The body is terminated by a line
with a count of zero. This line consists of one ASCII SPACE.
The trailer line consists of end on a line by itself.
(exerpted from uuencode.5 man page from SunOS 4.1.1 w/o perm.)
-JimC
--
James H. Cloos, Jr. Phone: +1 716 673-1250
cloos@ACSU.Buffalo.EDU Snail: PersonalZipCode: 14048-0772,
USA
cloos@ub.UUCP Quote: <>